<!DOCTYPE html>
<title>Verify media element's "src" attribute on "loadstart" event.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");
    var mediaFile = "content/test.ogv";

    video.onloadstart = t.step_func_done(function () {
        var url = video.currentSrc;
        assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);

        url = video.src;
        assert_equals(url.substr(url.lastIndexOf("/media/")+7), mediaFile);

        assert_equals(video.getAttribute("src"), mediaFile);
    });

    video.src = mediaFile;
});
</script>